// 项目相关功能
document.getElementById('projectsLabel').onclick = () => {
    const idFolderPath = path.join(__dirname, '..', 'ID');
    try {
        const folders = fs.readdirSync(idFolderPath);
        const matchingFolder = folders.find(folder => folder.startsWith(selectedFileName));

        if (matchingFolder) {
            const skillpointPath = path.join(idFolderPath, matchingFolder, 'skillpoint.json');
            if (fs.existsSync(skillpointPath)) {
                loadProjectsList(skillpointPath);
            } else {
                throw new Error('skillpoint.json not found');
            }
        } else {
            throw new Error('Matching folder not found');
        }
    } catch (error) {
        console.error('Error:', error);
        const fileList = document.getElementById('fileList');
        fileList.innerHTML = '读取文件夹失败：' + error.message;
    }
};

// 项目相关的其他函数...
function loadProjectsList(filePath) {
    // ... 原有的loadProjectsList函数代码 ...
}

function showProjectForm(filePath) {
    // ... 原有的showProjectForm函数代码 ...
}

// 其他项目相关函数... 